package com.tiankun.eurekauserinfo.controller;

import com.tiankun.eurekauserinfo.proxy.GoodsHandler;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;

/**
 * Created with IntelliJ IDEA
 * User: bear
 * Date: 2020/11/13
 * Description
 * Version: V1.0
 */

@RestController
public class FeignController {

    /*
    这里类似于ribbon，提供一个对外访问的接口地址，
    然后根据ServiceFeignByShow接口来决定调用哪一个子模块服务和哪一个接口地址
     */

    @Resource
    private GoodsHandler goodsHandler;

//    @PostMapping(value = "goods",produces = MediaType.APPLICATION_JSON_VALUE)
    public void goodsDetails(Integer godId){
        System.out.println(goodsHandler);
        Map<String,Integer> map=new HashMap<>();
        map.put("godId",godId);
        Map map1 = goodsHandler.goodsDetails(map);
        System.out.println(map1);
    }

}
